1. Field of the Invention
The present invention relates generally to digital image processing, and more particularly, to an imaging apparatus and an imaging processing method capable of quickly performing digital image processing.
2. Description of the Related Art
An image compression encoding in a JPEG mode processes one entire screen as one unit. On the other hand, one image can be divided into a plurality of blocks in a vertical direction and the divided blocks are processed in order to save capacities of a line memory, within a Large Scale Integration (LSI) circuit installed in a digital still camera and the like.
Accordingly, in order to process one entire image and then make the image be in a JPEG compressible state, it is required to stop a processing for all blocks and record a result of the processing in an external memory such as an SDRAM and the like to combine the blocks and the result of the processing. Further, a JPEG compression encoder for JPEG compression reads an image configured in an external memory to execute a compression encoding. To this end, the JPEG compression in a digital still camera is performed through a process of recording one image in an external memory, such as an SDRAM, at all times and also reading the image from the corresponding external memory.
In many cases, a speed capability of a conventional digital still camera is determined by a speed capability of an imaging apparatus. Further, the speed capability of the digital still camera requires only a continuous shooting capability in a degree of three frames to seven frames per second. However, the imaging apparatus currently has a high capability, and there is a trend towards using a resolution of 12 to 20 megapixels or more. Further, the speed capability currently requires a continuous shooting capability in a degree of 10 to 15 frames per second, and a processing capability required for the digital still camera becomes much higher in comparison with the conventional camera.
For this reason, when reading from and writing to the external memory of the image apparatus are repeatedly performed for the JPEG compression encoding of the image, power consumption increases and costs also increase due to an increase in the number of mounted external memories for resolving a low speed problem according to an increase in the reading and writing. Accordingly, it is typically required to execute the JPEG compression encoding of the image without performing the reading from and the writing to the external memory as much as possible.
In order to execute the JPEG compression encoding of the image without the use of the external memory as much as possible, there is a method of executing the JPEG compression encoding for each of a plurality of blocks vertically divided from one image and combining the blocks in performing a record in a recording medium. Accordingly, the number of accesses to the external memory is reduced. For example, Japanese Patent Application No. 2002-354364 discloses executing the JPEG compression encoding for each of the plurality of blocks vertically divided from one image. The JPEG compression encoding is performed by adding a Restart (RST) marker code to each of the divided blocks and an image combination after the compression. However, differential encoding is not used in a boundary of the divided blocks, so that encoding efficiency is low and there is a limitation in an image size of the divided block.
FIG. 1 illustrates the technology, disclosed in Japanese Patent Application No. 2002-354364, of adding a Restart Marker code (RST) to each of a plurality of blocks vertically divided from one image in order to reduce the number of accesses to an external memory in a Joint Photographic Expert Group (JPEG) compression encoding.
The JPEG compression encoding does not have to be performed for one entire image but can be performed after separating parts of the image by the RST maker codes. FIG. 1 illustrates compression encoding performed by dividing one image into four blocks (tile 0, tile 1, tile 2, and tile 3) and adding the RST marker code to a rightmost side of an MCU line of each block. When one image is divided into a plurality of blocks, the RST marker code is added to an end of the Minimum Coded Unit (MCU) line of each block and then encoding is performed.
However, when the encoding is performed as described above, a data storing direction becomes a direction in units of blocks, and does not correspond to “tile 0→tile 1→tile 2→tile 3. Accordingly, in order to store the image data after the encoding, rearrangement according to an order of an MCU line in an uppermost row of tile 0→an MCU line in an uppermost row of tile 1→ . . . is required.
Since a variable length encoding is used in JPEG encoding, a code amount for each pixel or MCU is not consistent, and the encoding is not performed in units of bytes. However, since the RST marker code is needed to be in a byte boundary, each MCU row becomes the byte unit, and thus handling in the external memory is simple.
However, this method of performing a compression by adding the RST marker code has the following problems.
First, when compression is performed by adding the RST marker code, encoding efficiency deteriorates. In JPEG, encoding is performed by taking a differential to perform a Direct Current (DC) prediction based on information on the block in a left side. When the image is divided into a plurality of blocks and the blocks are separated by the RST marker code, the differential is reset in units of blocks, so that a configuration is simple. However, the number of RST marker codes corresponding to the division is required to be added and encoding efficiency deteriorates since the differential encoding cannot be used between blocks.
FIG. 2 illustrates a case where differential encoding is not used between blocks in the prior art. As illustrated in FIG. 2, encoding can be performed between MCUs in the same block by performing a DC prediction. However, since differential encoding cannot be used between different blocks, encoding efficiency deteriorates in a part escaping from the corresponding block.
Subsequently, there is a limitation in an image size in the compression performed by adding the RST marker code. The image size between RST marker codes is required to be uniform. In general, since the compression is performed in units of 16 vertical pixels based on a luminance component in the JPEG image of the digital still camera, each block must be in units of 16 pixels. For example, when there is a configuration of vertically dividing an image into four blocks, an image size can be changed only in units of 64 pixels.
However, although a block size becomes smaller, such as 256 horizontal pixels or 512 horizontal pixels, an entire image becomes larger, such as 5000 to 8000 pixels. Accordingly, when an image is processed by dividing the image into, for example, 32 blocks, an image size is changed only in units of 256 pixels.
However, such a suitable imaging device is by no means common, and black data may be inserted into a right side of an indivisible part of the image. FIG. 3 illustrates an example of the above case. When the image size is 7952 pixels in a horizontal direction, and a width of each block is 256 pixels, only 16 pixels are actual image data in a rightmost block. If the black data is not inserted into the remaining pixels, the pixels cannot be processed as a block.